package com.darrenchan.netease04

object CurryingFunction {
  def main(args: Array[String]): Unit = {
    println(t1()(1)) //11
    println(t2(1)) //11
//    println(t3(1)) //报错，所以要是想这么调用，只能选择采用implicit
  }

  //返回函数类型
  def t1(y: Int = 10) = (x: Int) => x + y
  //普通函数类型
  def t2(x: Int, y: Int = 10) = x + y
  //柯里化函数
  def t3(x: Int)(y: Int = 10) = x + y
}
